package com.yyds.blackmagic.controller;

import com.yyds.blackmagic.entity.Chapter;
import com.yyds.blackmagic.mapper.ChapterMapper;
import com.yyds.blackmagic.service.ChapterService;
import com.yyds.blackmagic.vo.ActionResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName ChapterController
 * @Auther Dell
 * @Date 2021/12/16 15:33
 **/
@RestController
@Slf4j
@RequestMapping("/api")
public class ChapterController {
    @Resource
    private ChapterService chapterService;

    @GetMapping("/getmain/{bid}/{id}")
    public ActionResult selectMu(@PathVariable("bid")int bid,@PathVariable("id") int id){
        Chapter chapterMapper = chapterService.selectMu(bid,id);
        log.info("chapter controller");
        return new ActionResult(200,null,chapterMapper);
    }

}
